#include <iostream>
#include <future>
#include <thread>
using namespace std;
int main()
{
    // 2、std::launch::deferred：延迟执行，直到调用 .get() 时才执行。
    auto fut = std::async(std::launch::deferred, []()
               { cout << "async task id is :" << this_thread::get_id() << endl; });
    // 主线程可以继续做其他事情
    cout << "main thread id is :" << this_thread::get_id() << endl;
    fut.get();
    return 0;
}